package main.java.study.step02;

/**
 * @author liuwenxiu
 * @Description:
 * @date 2022-7-12 14:05
 */
public class Student {
    private String id;
    private String name;
    private Integer classNumber;

    public Student() {
        System.out.println("执行无参构造方法");
    }

    public Student(String id, String name) {
        this.id = id;
        this.name = name;
        System.out.println("执行两参构造方法");
    }

    public Student(String id, String name, Integer classNumber) {
        this(id,name);
        this.classNumber = classNumber;
        System.out.println("执行三参构造方法");
    }

    private void read() { }
    private void write() { }

    @Override
    public String toString() {
        return "Student{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", classNumber=" + classNumber +
                '}';
    }

    public static void main(String[] args) {
        Student student = new Student("1001","Sakura",11);
        System.out.println(student);
    }
}
